# with open("1.txt", "w") as file:
#     file.write("hello world")

# file = open("1.txt", "w", encoding="utf-8")
# file.writelines(["一二三四"])
# file.close()

# file = open("2.txt", "w", encoding="utf-8")
# file.write("人生苦端，我用python")
# file.close()
#
# file = open("2.txt", "r", encoding="utf-8")
# # str = file.readline()
# str = file.read(1024)
# print(str)

# file = open("2.txt", "w")
# file.write("人生苦端，我用python")
# file.close()
#
# file = open("2.txt", "r")
# # str = file.readline()
# str = file.read()
# print(str)


# with open("3.txt", "w+") as file:
#     file.write("hello world")
#     file.seek(0) # 修改文件指针
#     str = file.read()
#     print(str)
#     file.close()




